package com.ruoyi.custom.service.impl;

import com.ruoyi.custom.domain.ConsultingTeacher;
import com.ruoyi.custom.mapper.ConsultingTeacherMapper;
import com.ruoyi.custom.service.IConsultingTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ConsultingTeacherServiceImpl implements IConsultingTeacherService {
    @Autowired
    private ConsultingTeacherMapper consultingTeacherMapper;
    @Autowired
    private RedisTemplate redisTemplate;
    @Override
    public List<ConsultingTeacher> getAll() {
        // 查询全部咨询老师
        List<ConsultingTeacher> all = consultingTeacherMapper.getAll();
        redisTemplate.opsForValue().set("teacher_consultation",all);
        return all;
    }
}
